<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

<div id="app">
  <!-- 显示组件 -->
  <cpn><button>按钮</button></cpn>
  
  <!-- 替换指定具名插槽 -->
  <cpn><label slot="center">我是标题</label></cpn>
</div>

<template id="cpn">
  <div>
    <slot name="left"><span>左边</span></slot>
    <slot name="center"><span>中间</span></slot>
    <slot name="right"><span>右边</span></slot>
    <slot><button>默认按钮</button></slot>
  </div>
</template>


<script src="../js/vue.js"></script>
<script>
  
  const app = new Vue({
    el : '#app',
    data : {
      message : "I don't wanna see u anymore"
    },

    /* 组件注册 */
    components : {
      cpn : {
        template : '#cpn'
      }
    }
  })
</script>

</body>
</html>
